<?php

 /**
  * @package JooS
  * @subpackage Syntax_PHPackager
  */

  require_once "JooS/Syntax/Complex/Transition.php";

 /**
  * Function ::= ( Name, { ".", Name } ), "(", List, ")";
  */
  class JooS_Syntax_PHPackager_Function_Call extends JooS_Syntax_Complex_Transition {
    /**
     * @return string
     */
    public function compile() {
      $ret = parent::compile();
      if ($ret !== false) {
        $ret = in_array($this->getParsedValue(0), self::$_phpReservedWords) ? false : "\$this->_call->" . $ret;
      }
      return $ret;
    }

    /**
     * @return JooS_Syntax_Complex_Concatenate
     */
    protected function createRule() {
      return $this->createSyntax("Complex_Concatenate", array(
        $this->createSyntax("Common_Name"), 
        $this->createSyntax("Common_Whitespace"), 
        $this->createSyntax("Simple_Symbol", "("), 
        $this->createSyntax("Common_Whitespace"), 
        $this->createSyntax("PHPackager_List"), 
        $this->createSyntax("Common_Whitespace"), 
        $this->createSyntax("Simple_Symbol", ")"), 
      ));
    }
  }
